var vm = new Vue({
    el: "#vvm",
    created: function () {
        // this.gettime();
        // this.getlist();
    },
    data: {
        time: 0,
        onelist: [],
        list: []
    },
    methods: {
        getAllBucket: function () {
            $.ajax({
                type: "GET",
                url: "/minio/bucket/all",
                contentType: "application/json",
                success: function (r) {
                    let data = r.data;
                    console.log("---------" + r);
                    console.log("---------" + data);
                    console.log("---------" + data.key);
                    console.log("---------" + data.test);

                    // let data = r;
                    // console.log("---------" + data);
                    // for (let i = 0; i < data.size; i++) {
                    //     console.log(data[i].name)
                    //     console.log(r[i].creationDate)
                    // }

                    // vm.time = r.time;
                    // console.log(vm.time);
                    // var date = new Date(vm.time);
                    // $("#nowtime").replaceWith("<h1>" + date + "</h1>");
                }
            });
        },
        getBucketList: function () {
            $.ajax({
                type: "GET",
                url: "/minio/list",
                contentType: "application/json",
                success: function (r) {
                    let data = r.data;
                    console.log("---------" + r);
                    console.log("---------" + data);
                    console.log("---------" + data.key);
                    console.log("---------" + data.test);
                }
            });
        },
        gettime: function () {
            $.ajax({
                type: "GET",
                url: "/minio/bucket/all",
                // contentType: "application/json",
                success: function (r) {
                    console.log("-------------------------------------" + r);

                    // vm.time = r.time;
                    // console.log(vm.time);
                    // var date = new Date(vm.time);
                    // $("#nowtime").replaceWith("<h1>" + date + "</h1>");
                }
            });
        },
        getlist: function () {
            $.ajax({
                type: "GET",
                url: "../../admin/list",
                // contentType: "application/json",
                success: function (r) {
                    vm.list = r.list;
                    for (var i = 0; i < r.list.length; i++) {
                        $("#tabletext").append(
                            "<tr><td class=\"td\">" + r.list[i].id + "</td><td class=\"td\">" + r.list[i].name + "</td><td class=\"td\">" + r.list[i].password + "</td></tr>"
                        );
                    }
                    // console.log(r.onelist);
                }
            });
        },
    }
});